home *** CD-ROM | disk | FTP | other *** search
/ Champak 66 / Vol 66.iso / games / bailer.swf / scripts / DefineSprite_131_symItem / frame_1 / DoAction.as
Text File  |  2013-04-24  |  1KB  |  63 lines

  1. function _frameStep1()
  2. {
  3.    var _loc0_ = null;
  4.    var _loc2_ = this._xscale += (100 - this._xscale) * 0.5;
  5.    if(_loc2_ > 99)
  6.    {
  7.       _loc2_ = 100;
  8.    }
  9.    this._xscale = this._yscale = _loc2_;
  10.    this._x += ax * 100 / _loc2_;
  11.    this._y += ay;
  12.    var _loc3_ = ay;
  13.    ay += 2;
  14.    if(_loc3_ < 0 && ay >= 0)
  15.    {
  16.       if(this.item_mc != undefined)
  17.       {
  18.          this.item_mc.gotoAndStop(2);
  19.       }
  20.    }
  21.    if(_loc2_ >= 100)
  22.    {
  23.       this.onEnterFrame = _frameStep2;
  24.    }
  25. }
  26. function _frameStep2()
  27. {
  28.    this._x += ax;
  29.    this._y += MOVE_SPEED[no - 1];
  30.    if(_root.chara_mc.xIsHit(this))
  31.    {
  32.       this.removeMovieClip();
  33.    }
  34.    if(this._y > Stage.height + this._height)
  35.    {
  36.       if(no != 6 && _root.gameState == 1)
  37.       {
  38.          this._parent.missCnt = this._parent.missCnt + 1;
  39.       }
  40.       this.removeMovieClip();
  41.    }
  42. }
  43. var MOVE_SPEED = [12,10,7,8,13,15];
  44. var state = 0;
  45. var ax = _root.levelNo >= 3 ? Math.random() * 4 - 2 : 0;
  46. var ay = -10;
  47. this.gotoAndStop(no);
  48. if(no != 6)
  49. {
  50.    this._rotation = -20 + Math.random() * 40;
  51. }
  52. var w = this._width + 10;
  53. if(this._x - w < 0)
  54. {
  55.    this._x += w;
  56. }
  57. if(this._x + w >= Stage.width)
  58. {
  59.    this._x -= w;
  60. }
  61. this._xscale = this._yscale = 10;
  62. this.onEnterFrame = _frameStep1;
  63.